<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<base href="${request.contextPath}/">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>管理系统</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
		<link rel="stylesheet" type="text/css" href="style/web/css/login2.css"/>
		<script type="text/javascript" src="style/web/js/jquery-1.11.2.min.js"></script>
		<!-- <script disable-devtool-auto src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script> -->
	</head>
  
  	<body>
		<div style="height:100%">
			<div style="background-color: #fff; background-repeat: no-repeat;">
				<div style="margin-left:16%;position:relative;margin-top:2%;font-size:30px;font-weight:bold;color:#2795dc;">
					XX管理系统
				</div>
			</div>
			<div style="background-color: #02284C; background-repeat: no-repeat; position:fixed;width:100%;height:80%;top:8.5%;">
				<div style="width:1200px;height:100%;margin:0px auto;position:relative;top:0">
					<div class="label-box">
						<table>
							<tr>
								<td style="padding: 10px;">
									<img src="style/web/images/lb1.png" />
								</td>
								<td style="padding: 10px;">
									<img src="style/web/images/lb2.png" />
								</td>
							</tr>
							<tr>
								<td style="padding: 10px;">
									<img src="style/web/images/lb3.png" />
								</td>
								<td style="padding: 10px;">
									<img src="style/web/images/lb4.png" />
								</td>
							</tr>
						</table>
					</div>
				<div class="login"  id="login" onkeydown="keyDownLogin(event);">
				    <div class="header">
						<div style="color:#0180cf;font-size:18px;padding:20px 25px 20px">用户登錄</div>
				    </div>
				    <div class="web_qr_login" id="web_qr_login" style="display: block; height: 260px;">
					<!--登录-->
					<form id="login-form" name="loginForm" action="login" method="post">
						<div class="web_login" id="web_login">
							<div class="login-box">
								<div class="login_form">
									<div class="uinArea" id="uinArea">
										<div class="inputOuter" id="uArea">
											<input type="text" placeholder="用户名" 
											name="username"  id="j_username" value="" autocomplete="off" class="inputstyle"/>
										</div>
									</div>
									<div class="pwdArea" id="pwdArea">
										<div class="inputOuter" id="pArea">
											<input type="password" placeholder="密码" name="password"  id="j_password" value="" autocomplete="off" class="inputstyles"/>
										</div>
									</div>
									<div class="codeArea" id="codeArea">
										<!-- <label class="input-tips" for="p" style="margin-top:10px;">驗證碼：</label>  -->
										<div class="codeOuter" id="pArea">
											<input type="text" id="inputCode" name="code" placeholder="请輸入右側驗證碼"  class="codeinput" autocomplete="off"/>
											<img name="verifyCodeImg" src="${request.contextPath}/verifyImg" style="cursor: hand; position:relative; top:12px;" width="85px" height="38px" alt="看不清，点击换一张" onclick="refresh(this);" />
										</div>
									</div>
									<div style="padding-left:3px;margin-top:10px;height:30px;width:300px;"><input id="loginBtn" type="button" value="登 錄"  class="button_blue" onclick="doSubmit();"/></div>
					    			<p style="color:red;line-height:20px;text-align:center;"><#if message??>${message}</#if></p>
							   </div>
				            </div>
						</div>
				    <!--登录end-->
				    </form>
				  </div>
				</div>
			</div>
			</div>
			<div class="copyrightss" style="position:absolute;width:1200px;border:1px solid #eee;"></div>
			<div class="copyrights" style="position:absolute;">CopyRight &copy; 2018 shanhanyu@163.com&nbsp;&nbsp;版權所有</div>
		</div>
		<script type="text/javascript">
			$(function(){
				if (window != top) {
					top.location.href="login";
				}
			})
			
    		/**
    		 * 校驗并執行表单提交
    		 */
    		function doSubmit(){
    			var username = $("input[name='username']").val();
    			var password = $("input[name='password']").val();
    			if(username == "" || password == ""){
    				if(username == ""){
    					alert("请輸入用户名!");
    					$("input[name='username']").addClass("error").focus();
    					return false;
    				}else if(password == ""){
    					alert("请輸入密码!");
    					$("input[name='password']").addClass("error").focus();
    					return false;
    				}
    			}
    			$("input[name='username']").removeClass("error");
    			$("input[name='password']").removeClass("error");
    			$("#login-form").submit();
    		}
    		
    		/**
    		 * 回车提交
    		 * @param event
    		 * @return
    		 */
    		function keyDownLogin(event){
    			var ev= window.event||event;
    			if (ev.keyCode == 13) {
    				doSubmit();
    			}
    		}
    		//刷新驗證碼
    		function refresh(obj) {
    			obj.src = "${request.contextPath}/verifyImg?"+Math.random();
    		}
			
		</script>
	</body>
</html>